<!DOCTYPE html>

<html>
 <head>
 <title>Notification Example</title>
 <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
 <script type="text/javascript" charset="utf-8">    
 	// Wait for device API libraries to load    //  
  document.addEventListener("deviceready", onDeviceReady, false);    // device APIs are available    //  
  function onDeviceReady() { 
        }// Empty
 
 
	function showSomething()
	{
 		//This example shows one way to implement the plugin's JavaScript interface:  
       //cordova.exec(function(win){alert(win);}, function(err) {
       //    alert(err);
       //}, "Echo", "echo", ['myName']);

		try	{
			var time = parseInt( prompt("Please enter timeInMillis", "10000"));
			time += new Date().getTime();
	   		var notificationObject = {title: "this is Title", message:"show Message"};
	   		var alarmJsonObject = {alarmId:1, timeInMillis:time, htmlPath:"Alarm.html", notification:notificationObject};
	   		navigator.alarmgap.saveAlarm(alarmJsonObject, success, error);
		}catch(err){
			alert(err);
		}
	}
	function stopAlarm()
	{
		navigator.alarmgap.stopAlarm(1);
	}
	function success() {
		//alert("success");	
	}
	function error() {
		alert("error");
	}
	
 </script>
 </head>

 <body>
<p><a href="#" onclick="showSomething(); return false;">Show Alert</a></p>
<p><a href="#" onclick="playBeep(); return false;">Stop Alert</a></p>
<p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>
</body>
</html>